package com.dmzc.stage1.chapter1;

/***
 * Thread中的模板方法模式
 */
public class TemplateMethod {
    public static void main(String[] args) {
        TemplateMethod t1=new TemplateMethod(){
            @Override
            protected void wrapPrint(String message) {
                System.out.println("++"+message+"++");
            }
        };
        t1.print("hello world");
    }
    public final void print(String message){
        System.out.println("$$$$$$$$$");
        wrapPrint(message);
        System.out.println("#########");
    }
    protected void wrapPrint(String message){

    }
}
